/* Copyright 2008, Arun Zaheeruddin (a.reginald@gmail.com)
 * 
 * Licensed under the GNU Lesser General Public License, Version 3.0 (the "License").
 * A copy of the License may be obtained from http://www.gnu.org/licenses/lgpl-3.0.txt
 * unless it is otherwise distributed with the source-code (the "Source").
 * Consider reviewing the License for further details about using this Source in your
 * applications and projects.
 *
 * @author Arun Zaheeruddin
 * @version 0.1.0.0
 */

package com.db2object.data;

public class DataColumn
{
	private String name;
	private String caption;
	private int ordinal;
	private boolean nullable;
	private boolean autoIncrementing;
	private Class dataType;
	private int maximumLength;
	private DataTable table;
	public DataColumn()
	{
		this.name = null;
		this.caption = null;
		this.ordinal = 0;
		this.nullable = true;
		this.autoIncrementing = false;
		this.dataType = Object.class;
	}
	public DataColumn(String name)
	{
		this();
		this.name = name;
		this.caption = name;
	}
	public void setName(String name)
	{
		this.name = name;
	}
	public String getName()
	{
		return this.name;
	}
	public void setCaption(String caption)
	{
		this.caption = caption;
	}
	public String getCaption()
	{
		return this.caption;
	}
	public void setOrdinal(int ordinal)
	{
		this.ordinal = ordinal;
	}
	public int getOrdinal()
	{
		return this.ordinal;
	}
	public void setNullable(boolean nullable)
	{
		this.nullable = nullable;
	}
	public boolean isNullable()
	{
		return this.nullable;
	}
	public void setAutoIncrementing(boolean autoIncrementing)
	{
		this.autoIncrementing = autoIncrementing;
	}
	public boolean isAutoIncrementing()
	{
		return this.autoIncrementing;
	}
	public void setDataType(Class dataType)
	{
		this.dataType = dataType;
	}
	public Class getDataType()
	{
		return this.dataType;
	}
	public void setMaximumLength(int maximumLength)
	{
		this.maximumLength = maximumLength;
	}
	public int getMaximumLength()
	{
		return this.maximumLength;
	}
	public void setTable(DataTable table)
	{
		this.table = table;
	}
	public DataTable getTable()
	{
		return this.table;
	}
}